﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using TrackIT.Common;

namespace TrackIT.UnitTest
{
    [TestClass]
    public class PasswordManagerTest
    {
        [TestMethod]
        public void PasswordManager_ConstructorTest()
        {
            PasswordManager target = new PasswordManager();
            Assert.IsNotNull(target);
        }

        [TestMethod]
        public void PasswordManager_EncryptDecryptTest()
        {
            PasswordManager target = new PasswordManager();
            Assert.IsNotNull(target);

            string expected = "test123%^5&(Efs";
            string encryptedString = PasswordManager.EncryptToBase64String(expected);

            Assert.IsTrue(!string.IsNullOrWhiteSpace(encryptedString));
            string actual = PasswordManager.DecryptFromBase64String(encryptedString);

            Assert.AreEqual(expected, actual);
        }
    }
}
